#include "Graph.h"

int main()
{
    int n, m;
    cin >> n;//顶点数
    cin >> m;//边数

    int u[m], v[m], weight[m];

    for (int i = 0; i < m; i++)
    {
        cin >> u[i];//第i条边顶点1
        cin >> v[i];//第i条边顶点2
        cin >> weight[i];//第i条边权重
    }

    Graph<int> graph(n, m, u, v, weight);

    for(int i=0;i<n;i++)
    {
        cout << "\n各个点到"<<i+1<<"的最短距离：" << endl;
         graph.Dijkstra(i+1);
    }

}
